//
//  JKUserManager.m
//  VistorDemo
//
//  Created by Jack on 2021/8/6.
//

#import "JKUserManager.h"

@implementation JKUserManager{
    JKUser *_currentUser;
}

+ (instancetype)sharedUserManager{
    static dispatch_once_t onceToken;
    static JKUserManager *manager = nil;
    dispatch_once(&onceToken, ^{
        manager = [[JKUserManager alloc] init];
    });
    return manager;
}

- (void)login:(JKUser *)user{
    if (user) {
        _currentUser = user;
    }
}

- (JKUser *)currentUser{
    return _currentUser;
}

- (void)signout{
    if (!_currentUser) {
        return;
    }
    _currentUser = nil;
}
@end
